package com.notecalendar.quartz.exception;

import java.util.HashMap;
import java.util.Map;

/**
 * Exception for evernote actions in quartz tasks
 * @author angelcereijo
 *
 */
public class QuartzActionException extends Exception{

	//Exception codes
	public final static int NOT_SUPPORTED_ACTION = 0;
	
	//Exception descriptions
	public final static String NOT_SUPPORTED_ACTION_DESC = "Action not supported";
	
	
	//Map for join codes and descriptions
	private final static Map<Integer, String> MAP_CODE_DESCRIPTION = 
		new HashMap<Integer, String>();
	{
		MAP_CODE_DESCRIPTION.put(NOT_SUPPORTED_ACTION, NOT_SUPPORTED_ACTION_DESC);
	}
	
	private int exceptionType;
	private String exceptionTypeDesc;
	
	/**
	 * 
	 * @param exceptionType one of the valid exception codes.
	 */
	public QuartzActionException(int exceptionType){
		setExceptionType(exceptionType);
		setExceptionTypeDesc(MAP_CODE_DESCRIPTION.get(exceptionType));
	}

	public int getExceptionType() {
		return exceptionType;
	}

	private void setExceptionType(int exceptionType) {
		this.exceptionType = exceptionType;
	}

	public String getExceptionTypeDesc() {
		return exceptionTypeDesc;
	}

	private void setExceptionTypeDesc(String exceptionTypeDesc) {
		this.exceptionTypeDesc = exceptionTypeDesc;
	}
	
	
}
